Skip to content

port: keep Codex account labels private on Windows - #491

Merged
Finesssee merged 2 commits into
port/upstream-0.60.0from
port/micro-0.60.0-codex-privacy
Sep 13, 2026
Merged

port: keep Codex account labels private on Windows#491
Finesssee merged 2 commits into
port/upstream-0.60.0from
port/micro-0.60.0-codex-privacy

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Ports upstream commit 4cfb60692bdd8cfbba7a491e94bb121b59a835a5:
fix: keep Codex account switcher labels private and distinct (#3551).

When Hide Personal Info is enabled, Codex account labels and tooltips now use stable opaque Account N values in both the React account menu and the Windows native tray menu. Privacy-off display behavior is preserved.

Scope

Included:

  • React Codex account menu privacy labels and tooltips
  • React coverage for stable account ordering and privacy-off behavior
  • Windows native tray account labels with the same privacy contract

Excluded:

  • Rust account model or schema changes
  • bridge changes
  • localization changes
  • shared abstraction extraction
  • settings redesign
  • application version changes

Validation

Passed:

  • pnpm test — 60 files, 350 tests
  • pnpm build — locale drift, TypeScript, and Vite build passed
  • pnpm --dir apps/desktop-tauri run tauri:build:debug — fresh Windows debug binary built at target/debug/codexbar-desktop-tauri.exe
  • CUA validation against that fresh binary — app launch, Advanced → Hide Personal Info toggle/read-back, restoration, and clean shutdown
  • cargo fmt --all -- --check
  • git diff --check

Notes:

  • The local environment has one configured Codex account, so the multi-account menu is intentionally not exposed in the desktop UI. Focused tests cover the two-account privacy behavior, stable opaque ordinals, tie handling, and visible-label regression.
  • The native tray Rust test was blocked before execution because the Windows MSVC target resolves link.exe to the GNU link wrapper (link: extra operand ... .o). No Rust assertion failure was observed; toolchain repair is outside this PR.

Review boundary

Please review only these three files:

  • apps/desktop-tauri/src/components/CodexAccountsMenu.tsx
  • apps/desktop-tauri/src/components/CodexAccountsMenu.test.tsx
  • apps/desktop-tauri/src-tauri/src/tray_accounts.rs

Base branch: port/upstream-0.60.0
Head branch: port/micro-0.60.0-codex-privacy

Keep this PR open and unmerged.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f4bef9a4-f0af-4b09-b197-c31c13da5665

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo-nuclear code-quality review (Oracle-coordinated read-only swarm)

Verdict: PASS for merge readiness; no merge-blocking thermo finding.

The privacy behavior is localized to the Codex account menu and covered in both Rust and React tests. Hidden labels no longer expose email-like metadata, and the opaque ordinal mapping is stable across refresh order.

Two non-blocking maintainability observations are recorded for follow-up: (1) the ordinal policy is implemented in both apps/desktop-tauri/src-tauri/src/tray_accounts.rs:217 and apps/desktop-tauri/src/components/CodexAccountsMenu.tsx:39 with slightly different ID normalization; document or centralize that bridge contract to prevent drift, and (2) the new Account N label is hardcoded in both surfaces rather than using the surrounding localization path. Neither is a merge blocker for this scoped privacy fix.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Superseding thermo verdict — BLOCKED.

Oracle’s final adjudication confirms that the Rust tray path at tray_accounts.rs:204-233 and the React path around CodexAccountsMenu.tsx:47-65 and 165-170 independently implement the privacy-critical UUID-to-ordinal policy and silently manufacture fallback ordinals. Compute the opaque ordinal projection once in the Rust account domain, bridge it to React, reuse it in the native tray, and remove both fallbacks. Hardcoded English Account N is secondary cleanup; the duplicated policy is the merge blocker.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo follow-up: blocker fixed and validated.

Oracle had blocked this PR because Rust tray code and React code each derived privacy-safe account ordinals. Commit 4456f7c9c moves ordinal ownership into rust/src/codex_accounts/models.rs, returns account_ordinals through the bridge, and makes tray/React consume that canonical projection without discovery-order or index fallbacks. Stale bridge fixtures were updated as part of the contract change.

Validation: account Rust ordinal test 1/1; Tauri tray-account tests 4/4; Codex account React tests 15/15; TypeScript --noEmit; Rust and Tauri clippy with -D warnings; and cargo fmt --all -- --check all pass.

Oracle post-fix verdict: PASS. Hosted CI and Windows CUA evidence remain separate process gates.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Windows UI validation note: the repaired source passed TypeScript, Vite, and direct Tauri debug compilation, producing target/debug/codexbar-desktop-tauri.exe. The repository pnpm run tauri:build:debug wrapper could not complete because the local Corepack pnpm worker failed while repairing the isolated dependency directory. The CUA inventory then returned no native apps and its app-selection API was unavailable, so no screenshot/window assertion could be captured. This is a tooling evidence limitation; the code-level thermo verdict remains PASS.

@Finesssee
Finesssee merged commit 68cdeaf into port/upstream-0.60.0 Sep 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants